#include "mtm_ex4.h"
#include <string>
#include <sstream>
#include <stdarg.h>
using std::string;
using std::stringstream;

string mtm::getAlbumMinimalString(const string& title, const string& artist, const int& year, const int& price){
	stringstream sprice;
	sprice<<price;
	stringstream syear;
	syear<<year;
	return "|\t"+title+"\t|\t"+artist+"\t|\t"+syear.str()+"\t|\t"+sprice.str()+"\t|\n";
}

string mtm::getOrderHeaderString(const int& ordNum, const int& byWhoId, const int& size,const bool& wasPaid){
	string paid = (wasPaid == true ? "was":"wasn't");
	stringstream sordNum;
	sordNum << ordNum;
	stringstream sbyWhoId;
	sbyWhoId << byWhoId;
	stringstream ssize;
	ssize << size;
	string output =
			"=======================================================================\n";
	output = string(output) + "\tOrder no." + sordNum.str()	+ " for customer ID: " + sbyWhoId.str() + "\n";
	output +="\tOrder contains total of " + ssize.str() + " albums\n";
	output +="\tOrder "+paid+" paid\n";
	output +="\tShipment contains:\n";
	output+="-----------------------------------------------------------------------\n";
	return output;
}



string mtm::getAlbumsHeaderString(const int& size){
	stringstream ssize;
	ssize<<size;
	string output = "=======================================================================\n";
	output= string(output)+"\tAlbum inventory summary\n";
	output+="\tTotal of " + ssize.str()+" albums in store\n";
	output+="-----------------------------------------------------------------------\n";
	return output;
}

string mtm::getRecommendationsHeaderString(const int& size){
	stringstream ssize;
	ssize<<size;
	string output = "=======================================================================\n";
	output= string(output)+"\tRecommended albums\n";
	output+="\tTotal of " + ssize.str()+" recommendations for you\n";
	output+="-----------------------------------------------------------------------\n";
	return output;
}

string mtm::getCustomerHeaderString(const int& id, const string& name, const int& collectionSize){
	stringstream sid;
	sid<<id;
	stringstream ssize;
	ssize<<collectionSize;
	string output = "=======================================================================\n";
	output=string(output) + "\tCustomer details report\n";
	output+= "\tID: "+sid.str()+"\tName: "+name+"\n";
	output+="\tOwns total of "+ssize.str()+" albums\n";
	output+="-----------------------------------------------------------------------\n";
	return output;
}

string mtm::getRevenueHeaderString(const int& numOfCustomers,const int& numOfAlbumsSold, const int& totalAmountOfMoney){
	stringstream snumOfCustomers;
	snumOfCustomers<<numOfCustomers;
	stringstream snumOfAlbumsSold;
	snumOfAlbumsSold<<numOfAlbumsSold;
	stringstream stotal;
	stotal<<totalAmountOfMoney;
	string output = "=======================================================================\n";
	output=string(output) + "\tRevenue report\n";
	output+= "\tNumber of customers: "+snumOfCustomers.str()+"\n";
	output+="\tNumber of albums sold: "+snumOfAlbumsSold.str()+"\n";
	output+="\tTotal revenue: "+stotal.str()+" dollars\n";
	output+="-----------------------------------------------------------------------\n";
	return output;
}

string mtm::getRevenueFromCustomerString(const int& id, const string& name, const int& totalNumOfDisks, const int& totalRevenue){
	stringstream sid;
	sid<<id;
	stringstream stotal;
	stotal<<totalNumOfDisks;
	stringstream stotalRev;
	stotalRev<<totalRevenue;
	return "|\t"+sid.str()+"\t|\t"+name+"\t|\t"+stotal.str()+"\t|\t"+stotalRev.str()+"\t|\n";
}

string mtm::getCustomerDescriptionString(const int& id, const string& name){
	stringstream sid;
	sid<<id;
	return "|\t"+sid.str()+"\t|\t"+name+"\t|\n";
}

string mtm::getCustomersHeaderString(const int& numOfCustomers){
	stringstream snumOfCustomers;
	snumOfCustomers<<numOfCustomers;
	string output = "=======================================================================\n";
	output=string(output) + "\tCustomers report\n";
	output+= "\tNumber Of Customers: "+snumOfCustomers.str()+"\n";
	output+="-----------------------------------------------------------------------\n";
	return output;
}

string mtm::getAlbumFullString(const int& barcode,const int& price,const int& year,const int& numPurchased,const string& title,const string& artist){
	stringstream sbarcode;
	sbarcode<<barcode;
	stringstream syear;
	syear<<year;
	stringstream sprice;
	sprice<<price;
	stringstream snumPurchased;
	snumPurchased<<numPurchased;
	string output ="| "+sbarcode.str()+"\t| "+title+"\t| "+artist+"\t| "+syear.str()+"\t| "+sprice.str()+"\t| "+snumPurchased.str()+"\t|\n";
	return output;
}




